import request from "@/utils/request";

enum RestaurantApi {
    // 获取所有餐馆
    GET_ALL_RESTAURANTS = "/restaurants/all",
    // 获取餐馆详情
    GET_RESTAURANT_DETAIL = "/restaurants/",
    //添加餐厅
    ADD_RESTAURANT = "/restaurants",
    //删除餐厅
    DELETE_RESTAURANT = "/restaurants",
}

export const getAllRestaurants = () => {
    return request({
        url: RestaurantApi.GET_ALL_RESTAURANTS,
        method: "get",
    });
}
export const getRestaurantDetail = (restaurantId: number) => {
    return request({
        url: RestaurantApi.GET_RESTAURANT_DETAIL + restaurantId,
        method: "get",
    });
}

export const addRestaurant = (data: any) => {
    return request({
        url: RestaurantApi.ADD_RESTAURANT,
        method: "post",
        data
    });
}
export const deleteRestaurant = (data: any) => {
    console.log(data);
    return request({
        url: RestaurantApi.DELETE_RESTAURANT + "/" + data,
        method: "delete",
    });
}
